<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/customer/customer.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/customer/customer.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'CustomerId',
                footer: "Foots",
                cnName: '客户管理',
                name: 'customer/customer',
                url: "/customer/",
                sortName: "CustomerId"
            });
            const editFormFields = ref({"CustomerNo":"","CompanyName":"","Contact":"","MoneyId":"","CustomerPhone":"","CustomerLandline":"","CustomerAddr":"","CustomerRemark":""});
            const editFormOptions = ref([[{"title":"客户编号","field":"CustomerNo","type":"text"}],
                              [{"title":"公司名","field":"CompanyName","type":"text"}],
                              [{"title":"联系人","field":"Contact","type":"text"}],
                              [{"dataKey":"币别","data":[],"title":"币别","field":"MoneyId","type":"select"}],
                              [{"title":"手机","field":"CustomerPhone","type":"text"}],
                              [{"title":"座机","field":"CustomerLandline","type":"text"}],
                              [{"title":"地址","field":"CustomerAddr","type":"text"}],
                              [{"title":"备注","field":"CustomerRemark","type":"textarea"}]]);
            const searchFormFields = ref({"CustomerNo":"","CompanyName":"","Contact":"","CustomerPhone":"","CustomerLandline":"","CustomerAddr":""});
            const searchFormOptions = ref([[{"title":"客户编号","field":"CustomerNo","type":"like"},{"title":"公司名","field":"CompanyName","type":"like"},{"title":"联系人","field":"Contact","type":"like"},{"title":"手机","field":"CustomerPhone","type":"like"},{"title":"座机","field":"CustomerLandline","type":"like"},{"title":"地址","field":"CustomerAddr","type":"like"}]]);
            const columns = ref([{field:'CustomerId',title:'CustomerId',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'CustomerNo',title:'客户编号',type:'string',width:110,align:'left',sort:true},
                       {field:'CompanyName',title:'公司名',type:'string',width:110,align:'left'},
                       {field:'Contact',title:'联系人',type:'string',width:110,align:'left'},
                       {field:'MoneyId',title:'币别',type:'int',bind:{ key:'币别',data:[]},width:110,align:'left'},
                       {field:'CustomerPhone',title:'手机',type:'string',width:110,align:'left'},
                       {field:'CustomerLandline',title:'座机',type:'string',width:110,align:'left'},
                       {field:'CustomerAddr',title:'地址',type:'string',width:110,align:'left'},
                       {field:'CustomerRemark',title:'备注',type:'string',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
